﻿using System.Text;
using System.Web;

namespace Chart.Net
{
    public class PlainText : Chart
    {
        public string Content { get; set; }

        public override string GetBody()
        {
            StringBuilder result = new StringBuilder();
            result.AppendFormat("<h1 id=\"{1}\">{0}</h1><div>", Title, string.IsNullOrEmpty(Title) ? "untitled" : Title.Replace(' ', '-'));
            result.AppendFormat("<pre>{0}</pre></div>", HttpUtility.HtmlEncode(Content));
            return result.ToString();
        }

        public override string GetScripts()
        {
            return string.Empty;
        }
    }
}
